Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Diagnostics.​Metrics.​Gauge<​T>

Assembly: System.Diagnostics.DiagnosticSource

Inheritance: object → InstrumentInstrument<​T> → Gauge

The Gauge is an instrument used to record non-additive values whenever changes occur. For example, record the room background noise level value when changes occur.

Properties

public InstrumentAdvice<​T>
Advice
public string
Description
Gets the instrument description.
public bool
Enabled
Gets a value that indicates if there are any listeners for this instrument.
public bool
IsObservable
Gets a value that indicates whether the instrument is an observable instrument.
public Meter
Meter
Gets the Meter that created the instrument.
public string
Name
Gets the instrument name.
public string
Unit
Gets the instrument unit of measurements.
Returns the tags associated with the instrument.

Methods

public void
Record​(T value)
Record the Gauge current value.
value The Gauge current value.
public void
Record​(T value, Collections.​Generic.​KeyValuePair<​string, object> tag)
Record the Gauge current value.
value The Gauge current value.
tag A key-value pair tag associated with the measurement.
public void
Record​(T value, Collections.​Generic.​KeyValuePair<​string, object> tag1, Collections.​Generic.​KeyValuePair<​string, object> tag2)
Record the Gauge current value.
value The Gauge current value.
tag1 A first key-value pair tag associated with the measurement.
tag2 A second key-value pair tag associated with the measurement.
public void
Record​(T value, Collections.​Generic.​KeyValuePair<​string, object> tag1, Collections.​Generic.​KeyValuePair<​string, object> tag2, Collections.​Generic.​KeyValuePair<​string, object> tag3)
Record the Gauge current value.
value The Gauge current value.
tag1 A first key-value pair tag associated with the measurement.
tag2 A second key-value pair tag associated with the measurement.
tag3 A third key-value pair tag associated with the measurement.
public void
Record​(T value, ReadOnlySpan<​Collections.​Generic.​KeyValuePair<​string, object>> tags)
Record the Gauge current value.
value The Gauge current value.
tags A span of key-value pair tags associated with the measurement.
public void
Record​(T value, Collections.​Generic.​KeyValuePair[] tags)
Record the Gauge current value.
value The Gauge current value.
tags A list of key-value pair tags associated with the measurement.
public void
Record​(T value, TagList& tagList)
protected void
RecordMeasurement​(T measurement)
Inherited from Instrument<​T>
protected void
RecordMeasurement​(T measurement, Collections.​Generic.​KeyValuePair<​string, object> tag)
Inherited from Instrument<​T>
protected void
RecordMeasurement​(T measurement, Collections.​Generic.​KeyValuePair<​string, object> tag1, Collections.​Generic.​KeyValuePair<​string, object> tag2)
Inherited from Instrument<​T>
protected void
RecordMeasurement​(T measurement, Collections.​Generic.​KeyValuePair<​string, object> tag1, Collections.​Generic.​KeyValuePair<​string, object> tag2, Collections.​Generic.​KeyValuePair<​string, object> tag3)
Inherited from Instrument<​T>
protected void
RecordMeasurement​(T measurement, TagList& tagList)
Inherited from Instrument<​T>
protected void
RecordMeasurement​(T measurement, ReadOnlySpan<​Collections.​Generic.​KeyValuePair<​string, object>> tags)
Inherited from Instrument<​T>
protected void
Publish​()
Inherited from Instrument
Activates the instrument to start recording measurements and to allow listeners to start listening to such measurements.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object